package org.ranch.web.propertyeditors;

import java.beans.PropertyEditorSupport;

import org.ranch.model.BaseData;

/**
 * base class for all data binding property editors
 *  
 */
public class BasePropertyEditor extends PropertyEditorSupport {

    /*
     * (non-Javadoc)
     * 
     * @see java.beans.PropertyEditorSupport#getAsText()
     */
    @Override
    public String getAsText() {
	if (super.getValue() != null && super.getValue() instanceof BaseData) {
	    return ((BaseData) super.getValue()).getId();
	}

	return super.getAsText();
    }

}
